/**
 * 
 */
const Menu = require("../model/menu");

module.exports = {
    findAll: async (params) => {
        return Menu.findAll({ where: params })
    },
    add: async (params) => {
        console.log("params:", params)
        return Menu.create(params)
    },
    update: async (params) => {
        return Menu.update(params, { where: { id: params.id } })
    },
    del: async (params) => {
        return Menu.destroy({ where: params })
    },
    findAllByRoleId: async (params) => {
        console.log("dao:",params)
        return Menu.findAll({ where: params })
    },
    findAllByParentId: async (params) => {
        let menuAry = await Menu.findAll({ where: params })
        return menuAry;
    }
}